CC = g++
AR = ar

target := tcp-server

DEFINES := -D_UNIX -D_LINUX
CFLAGS := -fPIC -Wall -g
LDFLAGS := -fPIC
INC_PATH := 

STATIC_LIBS +=
STATIC_LIB_PATH +=
LIBS += 
LIB_PATH +=

sources := main.cpp

__midobjs := $(patsubst %.c, %.o, $(sources))
__midobjs := $(patsubst %.cc, %.o, $(__midobjs))
objects := $(patsubst %.cpp, %.o, $(__midobjs))

goal:$(target)
	@echo "make done"

$(target):$(objects)
	$(CC) $(LDFLAGS) $^ -Wl,-Bstatic $(STATIC_LIBS) $(STATIC_LIB_PATH) -Wl,-Bdynamic $(LIBS) $(LIB_PATH) -o $@

%.o : %.c
	$(CC) $(CFLAGS) $(DEFINES) $(INC_PATH) -c $< -o $@

%.o : %.cc
	$(CC) $(CFLAGS) $(DEFINES) $(INC_PATH) -c $< -o $@
	
%.o : %.cpp
	$(CC) $(CFLAGS) $(DEFINES) $(INC_PATH) -c $< -o $@

.PHONY : clean
clean :
	@echo "clean..."
	-rm -rf *.o $(target)
